|
Design by contract (DbC), also known as contract programming, programming by contract and design-by-contract programming, is an approach for designing software. It prescribes that software designers should define formal, precise and verifiable interface specifications for software components, which extend the ordinary definition of abstract data types with preconditions, postconditions and invariants. These specifications are referred to as "contracts", in accordance with a conceptual metaphor with the conditions and obligations of business contracts. The DbC approach assumes all client components that invoke an operation on a server component will meet the preconditions specified as required for that operation. Where this assumption is considered too risky (as in multi-channel client-server or distributed computing) the opposite "defensive design" approach is taken, meaning that a server component tests (before or while processing a client's request) that all relevant preconditions hold true, and replies with a suitable error message if not. ==History== The term was coined by Bertrand Meyer in connection with his design of the Eiffel programming language and first described in various articles starting in 1986〔Meyer, Bertrand: ''Design by Contract'', Technical Report TR-EI-12/CO, Interactive Software Engineering Inc., 1986〕〔Meyer, Bertrand: ''Design by Contract'', in ''Advances in Object-Oriented Software Engineering'', eds. D. Mandrioli and B. Meyer, Prentice Hall, 1991, pp. 1–50〕〔Meyer, Bertrand: ''Applying "Design by Contract"'', in Computer (IEEE), 25, 10, October 1992, pp. 40–51, also available (online )〕 and the two successive editions (1988, 1997) of his book ''Object-Oriented Software Construction''. Eiffel Software applied for trademark registration for ''Design by Contract'' in December 2003, and it was granted in December 2004.〔(United States Patent and Trademark Office registration for "DESIGN BY CONTRACT" )〕〔(United States Patent and Trademark Office registration for the graphic design with words "Design by Contract" )〕 The current owner of this trademark is Eiffel Software.〔(Current status of United States Patent and Trademark Office registration for "DESIGN BY CONTRACT" )〕〔(Current status of United States Patent and Trademark Office registration for the graphic design with words "Design by Contract" )〕 Design by contract has its roots in work on formal verification, formal specification and Hoare logic. The original contributions include: *A clear metaphor to guide the design process *The application to inheritance, in particular a formalism for redefinition and dynamic binding *The application to exception handling *The connection with automatic software documentation 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「design by contract」の詳細全文を読む スポンサード リンク
|